local bowuguan = fk.CreateSkill {
  name = "bowuguan",
}

Fk:loadTranslationTable{
  ["bowuguan"] = "五关",
  [":bowuguan"] = "你可以将一张红色牌当【杀】使用。",
  ["#bowuguan"] = "请选择一张红色牌当【杀】使用",
  ["$bowuguan1"] = "单骑护嫂千里，只为桃园之义！",
  ["$bowuguan2"] = "吾神远涉，赤心归国！",
}

bowuguan:addEffect("viewas", {
  anim_type = "offensive",
  pattern = "slash",
  prompt = "#bowuguan",
  mute_card = true,
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).color == Card.Red
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local c = Fk:cloneCard("slash")
    c.skillName = bowuguan.name
    c:addSubcard(cards[1])
    return c
  end,
})

bowuguan:addAI(nil, "vs_skill")

return bowuguan